package com.example.democrud.aspect;

import org.apache.poi.ss.formula.functions.T;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName AOPConfig
 * @Author Administrator
 * @Date 2020/4/21   17:35
 */
@Configuration
@Aspect
public class AOPConfig {
    //@Pointcut("execution(public * *(..))") //所有public方法
    //@Pointcut("execution(* set*(..))") //set开头的方法
    //@Pointcut( "execution(public * com.example.democrud.controller.*.*(..))") //com.example.democrud.controller包下的所有方法
    //@Pointcut("execution(public * set*(..))") //set开头的public方法
    //@Pointcut("target(com.example.democrud.employee.EmployeeService)")//实现EmployeeService接口的所有类的所有方法
    //@Pointcut("target(org.springframework.transaction.annotation.Transactional)") //所有用 @Transactional注解的方法
    @Pointcut("target(org.springframework.stereotype.Controller)")//声明了@Controller 注解的累的所有方法
    public void UserCheckPointCut(){
    }
    //@Before("execution()")
    @Before("UserCheckPointCut()")
    public  void before (){}

    @Around("UserCheckPointCut()")
    public  void  around(ProceedingJoinPoint proceedingJoinPoint)throws Throwable{
        proceedingJoinPoint.proceed();
    }
}
